@layout("/common/_container.html",{js:["/assets/modular/recy/bins/bins.js","/assets/common/libs/rapid-validator/prototype_for_validation.js","/assets/common/libs/rapid-validator/validation_cn.js","/assets/common/libs/rapid-validator/tooltips.js"]}){
<div>
    <form class="layui-form model-form" id="jifenForm" name="jifenForm">
        <div class="layui-form-item">
            <div style="padding:10px;">空桶重量(单位：克)</div>
            <div style="padding-left:10px;">
                <input type="text" name="emptyBinWeight" id="emptyBinWeight" class="layui-input" placeholder="单位：克" value="${dict.description}">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn">修改</button>
            </div>
        </div>
    </form>
</div>
@}
<script>
    layui.use(["form","jquery","admin","ax"],function(){
        var $=layui.jquery;
        var form  = layui.form;
        var admin = layui.admin;
        var $ax = layui.ax;
        // 让当前iframe弹层高度适应
        admin.iframeAuto();
        form.on("submit",function(){
            var emptyBinWeight = $("#emptyBinWeight").val();
            if(emptyBinWeight=="" || !/^\d+$/gi.test(emptyBinWeight)){
                Feng.error("重量只能是数值！")
                return false;
            }
            var ajax = new $ax(Feng.ctxPath + "/bins/saveEmptyBinWeight", function (data) {
                Feng.success("空桶重量设置成功！");
                //传给上个页面，刷新table用
                admin.putTempData('formOk', true);

                //关掉对话框
                admin.closeThisDialog();
            }, function (data) {
                Feng.error("空桶重量设置失败！");
            });
            ajax.set("binWeight",emptyBinWeight);
            ajax.start();
        })
    })
</script>